import React, { Component } from 'react'
import yanzheng from 'prop-types'

export default class Navbar extends Component {
  render() {
      var {title, leftshow, rightshow} = this.props;
    return (
      <div>
          {leftshow && <button>返回</button>}
          {title}
          {rightshow && <button>前进</button>}
      </div>
    )
  }
}

Navbar.propTypes = {   //规定所传属性的类型
    title: yanzheng.string,
    leftshow: yanzheng.bool
}

Navbar.defaultProps = {
    leftshow: true,
    title:'',
    rightshow:true
}